import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '',
      redirect: '/desren/yunshang'
    },
    //主体框架
    {
      path: '/desren',
      redirect: '/desren/yunshang',
      component: () => import('@/components/homepage.vue'),
      children: [
        {
          path: 'guotai',
          component: () => import('@/components/zuopin/guotai.vue'),
        },
        {
          path: 'guibin',
          component: () => import('@/components/zuopin/guibin.vue'),
        },
        {
          path: 'jiudian',
          component: () => import('@/components/zuopin/jiudian.vue'),
        },
        {
          path: 'yunshang',
          component: () => import('@/components/zuopin/yunshang.vue'),
        }
      ]
    },
    //动态路由  项目详情
    {
      path: '/itemdeatil/:xmid',
      component: () => import('@/components/projectDetails/index.vue'),
    },
    //动态路由  作者详情
    {
      path: '/autodeatil/:auid',
      component: () => import('@/components/autodeatil/index.vue'),
    }
  ]
})
export default router;